home *** CD-ROM | disk | FTP | other *** search
/ Disc to the Future 2 / Disc to the Future Part II Programmer's Reference (Wayzata Technology)(6013)(1992).bin / MAC / MACSHELL / MS1 / MANUAL < prev    next >
Text File  |  1990-04-18  |  44KB  |  1,465 lines

  1. #############################################################################
  2. #
  3. #    MANUAL COMPILER FILE
  4. #
  5. #    This file contains the manual information for MacShell¬
  6. #    To recompile the manual file use
  7. #
  8. #    $ man filename -wc
  9. #
  10. #            the -w option 'wipes' manual resources
  11. #            the -c option compiles the file 'filename'
  12. #
  13. #    FORMATING CHARACTERS
  14. #
  15. #        '#' begins a comment line, all characters following are ignored.
  16. #        '<U> name'     begins a usage statment for command 'name'.
  17. #        '<M> name'    begins a manual statement for command 'name'.
  18. #
  19. #        Note : use the '###' markers to limit the line endings (they are the
  20. #        size of the minimum window on a compact Mac.
  21. #
  22. #############################################################################
  23. <U> man
  24. man commands - prints detailed explanation of a commands function
  25. <M> man
  26.     man [commands]
  27.     
  28.     man prints a detailed explanation of a command's function.
  29.     for a simple explanation use the 'usage' command.
  30.  
  31.     To see other summaries, use 
  32.  
  33.             man    shell
  34.             man    paths
  35.             man    patterns
  36.             man    commands
  37.             man    characters
  38.             man    variables
  39.             man    shortcuts
  40.  
  41.     options
  42.         -c        compile specified file/s into man and usage text.
  43.         -w        wipe existing man and usage text resources.
  44.         -e        echo names on compile.
  45.  
  46. #############################################################################
  47. <U> usage
  48. usage commands - prints a one line explanation of a commands function
  49. <M> usage
  50.     usage commands
  51.     
  52.     usage prints a simple, one line explanation of a command's function.
  53.     for a more through explanation use the 'man' command.
  54.  
  55.     options - none
  56.  
  57. #############################################################################
  58. #
  59. #                            GENERAL INFORMATION
  60. #
  61. #############################################################################
  62. <M> patterns
  63. MacShell¬ Patterns
  64.  
  65.     *            Match any characters including none
  66.     ?            Match any single character
  67.   [╔]            Match any enclosed character
  68.   [a-z]            Match any character in range a-z
  69.   [╔]+            Match any sequence of enclosed characters
  70.  
  71.     In general patterns can be used in the following specifiers
  72.     
  73.         files
  74.         directories
  75.         finder types and creators
  76.         resource types
  77.         menu names
  78.         window names
  79.  
  80. #############################################################################
  81. <M> shell
  82. MacShell¬ Shell Information
  83.  
  84.   MacShell was designed to provide a popular command line shell for application
  85. development that does not require large amounts of disk space and memory.
  86. MacShell uses the UNIX system as its command model.  MacShell provides several
  87. 'Mac-Like' features that allow customization of environment.  For the ultimate
  88. in user configurability we provide a linkable LSC project that you can add you
  89. own commands to.
  90.  
  91. Command execution
  92.  
  93.     To execute a command: Type the command name into the input pane and hit return.
  94.         
  95. Launch Applications
  96.  
  97.     Type in the pathname of the application to launch it.
  98.  
  99. Using Quotes
  100.     
  101.         When specifying paths that include names with embedded spaces, quote the 
  102.     entire argument with quotes, for example :
  103.  
  104.     $    ls 'Dev Folder' 'My Folder With Spaces'
  105.  
  106.     A short cut to using Quotes is to specify part of the name with a pattern,
  107.     for example :
  108.  
  109.     $    ls Dev* My*
  110.  
  111.     Please refer to the printed manual for more information.
  112.  
  113. #############################################################################
  114. <M> characters
  115. MacShell¬ Special Characters
  116.     
  117.     |            Pipe 
  118.     ;            Command separator
  119.     <            Input redirection
  120.     >            Output file creation
  121.     >>            Output file append
  122.     #            Start of comment terminated by newline
  123.  
  124.     space        Space separates words.
  125.     tab            Tab also separates words.
  126.     return        Return separates commands.
  127.     enter        Enter separates commands
  128.  
  129. Quoting conventions
  130.  
  131.     \            Quote the next character in pattern.
  132.   '╔'            Quote the enclosed except for '
  133.                   Note : If a trailing quote is not specified the remaining
  134.                   characters on the line are included in the quoted string.
  135.  
  136.     Please refer to the printed manual for more information.
  137.  
  138. #############################################################################
  139. <M> variables
  140. MacShell¬ shell vars
  141.  
  142.     UNIX shell vars
  143.  
  144.     $0                The name of the command procedure being executed
  145.     $1                The first argument, $2 second, etc.
  146.     $HOME            Default argument for the cd command
  147.     $CDPATH            The list of directories that is searched by the CD command
  148.                     Each directory is separated by a ;.
  149.     $PATH            A list of directories that contain commands
  150.                     Each directory is separated by a ;.
  151.     $PS1            The primary shell prompt string, by default $.
  152.     $PS2            The shell prompt for further input.  by default >.
  153.     $IFS            The set of character used for blank interpretation.
  154.                     This is usually space, tab and newline.
  155.  
  156.     Macintosh shell vars
  157.  
  158.     $BOOT            The volume name of the boot disk
  159.     $COMMAND        The name of the last command executed
  160.     $SHELL            The full pathname of the Shell
  161.     $SYSTEMFOLDER    The full pathname of the system folder
  162.     $USER            The current user name (initialized to the ╥Chooser╙ name)
  163.     $TIME            The current time
  164.     $DATE            The current date
  165.     $FREEMEM        The amount of free memory in MacShell heap
  166.  
  167.     name=val        Set name to specified value
  168.  
  169.     Example :
  170.         $ echo $FREEMEM   # print the free memory remaining.
  171.  
  172.     Please refer to the printed manual for more information.
  173.  
  174. #############################################################################
  175. <M> paths
  176. MacShell¬ UNIX paths
  177.  
  178.     //                Volume specifier.
  179.     /                Root specifier.
  180.     .                Currrent working directory.
  181.     ..                Parent working directory.
  182.     \                Parent working directory.
  183.     ...                Recursive search specifier.
  184.     ╔                Recursive search specifier (option-colon).
  185.  
  186. Path examples:
  187.  
  188.     $ cd //Floppy                Move working directory to 'Floppy' root
  189.     
  190.     $ ls -l //*                    List all volumes on line
  191.     
  192.     $ cat '/HD 80/myfile'        Catenate myfile at root of volume 'HD 80'
  193.     
  194.     $ cd  \Doc*                    Move to first directory matching 'Doc*' in parent
  195.                                 directory.
  196.     
  197.     $ ls .../*.c > source        List all C source file paths into file 'source'
  198.                                 that are in the current directory and its children.
  199.  
  200.     $ cd -d                        Use a dialog to set the working directory
  201.     
  202.     Please refer to the printed manual for more information.
  203.  
  204. #############################################################################
  205. <M> shortcuts
  206. MacShell¬ shortcuts
  207.     
  208.     Double click            Select word
  209.     Triple click            Select line
  210.  
  211.     UpArrow                    Move selection mark one line above current selection
  212.     DownArrow                Move selection mark one line below current selection
  213.     RightArrow                Move selection mark one character to the right
  214.     LeftArrow                Move selection mark one character to the left
  215.     
  216.     Option-UpArrow            Move selection mark to top of file
  217.     Option-DownArrow        Move selection mark to bottom of file
  218.     Option-LeftArrow        Move selection mark to left edge of current line
  219.     Option-RightArrow        Move selection mark to right edge of current line
  220.  
  221.     Help                    Activate man command
  222.     Home                    Move selection mark and view to top of file
  223.     PageUp                    Move view one page up
  224.     PageDown                Move view one page down
  225.     
  226.     Command-E                Execute selected text.
  227.     Command-Period            Interupt command (all shells).
  228.     Command-D                Interupt command (front most shell).
  229.     Command-Tab                Move from input/output pane to output/input pane.
  230.  
  231.     Command-UpArrow           Recall next command from history buffer
  232.     Command-RightArrow        Recall next command from history buffer
  233.     Command-DownArrow         Recall last command from history buffer
  234.     Command-LeftArrow        Recall last command from history buffer
  235.     Command-Space            Recall last command from history buffer
  236.  
  237.     If a file has the postfix '.script' then that file will be executed as a
  238.     shell script (as opposed to opened for editing) when double-clicked from
  239.     the Finder or opened from the File menu.
  240.  
  241.     Please refer to the printed manual for more information.
  242.  
  243. #############################################################################
  244. <M> commands
  245. MacShell¬ UNIX Commands
  246.     
  247.     alias        - define command alias 
  248.     cal            - print calendar
  249.     cat            - catenate and print files and/or standard input
  250.     cd            - change directories
  251.     cmp            - compare files
  252.     cp            - copy files in one of two formats
  253.     crypt         - encode files
  254.     decrypt     - decode files
  255.     date        - print time and date
  256.     df            - show disk (volume) free space
  257.     diff        - differential file compare
  258.     echo        - echo arguments to stdout
  259.     find        - find files
  260.     fgrep        - search files for strings
  261.     grep        - search files for patterns
  262.     hd            - dump files in hex
  263.     ls            - list files and directories
  264.     man            - prints detailed explanation of a commands function
  265.     mkdir        - make directories
  266.     mv            - move files in one of two formats
  267.     pr            - print text files
  268.     pwd         - print present working directory path
  269.     rm            - remove files
  270.     rmdir        - remove directories
  271.     set            - set shell variables
  272.     script        - run shell script
  273.     size        - print the size of data and resource forks
  274.     sh            - open a new shell
  275.     sleep        - suspend execution for an interval (Ticks)
  276.     touch        - update the date last modified of files
  277.     tr            - translate characters
  278.     unalias        - undefine command alias 
  279.     unset        - unset (remove) shell variables
  280.     usage        - prints a one line explanation of a commands function
  281.     wc            - count characters, words, and lines in text files
  282.  
  283. MacShell¬ UNIX Extensions
  284.  
  285.     cpt            - copy directories (trees)
  286.     mvt            - move directories (trees)
  287.     edit        - edit text files
  288.     read         - read text files
  289.  
  290. MacShell¬ Macintosh Commands
  291.  
  292.     about         - open about dialog
  293.     addmenu        - add or modify a menu
  294.     addsubmenu    - add a hierarchical 'sub' menu
  295.     clear        - erase all shell output
  296.     close        - close text window
  297.     delmenu        - remove menu and/or menu items
  298.     eject        - eject and unmount volume
  299.     new            - open a new shell or edit window (see prefs)
  300.     open        - open text files for editing
  301.     pagesetup    - open page setup dialog
  302.     play        - play sound files and resources
  303.     prefs        - set MacShell preferences
  304.     print        - open print job dialog
  305.     quit        - quit MacShell¬
  306.     restart        - restart the Macintosh
  307.     revert        - revert text window to last version saved.
  308.     save        - save the contents of window to file
  309.     saveas        - save the contents of window to new file
  310.     setfile        - set file attributes
  311.     shutdown    - shutdown the Macintosh
  312.     sound        - set sound volume
  313.  
  314. MacShell¬ Macintosh Development Commands
  315.  
  316.     dumpr        - dump resources (RMAKER format)
  317.     cmpr        - compare resources
  318.     cpr            - copy resources
  319.     dpb            - print directory ParamBlockRec information
  320.     environ        - print information about system environment
  321.     fpb            - print file ParamBlockRec information
  322.     lsr            - list resources
  323.     mvr            - move resources
  324.     rmr         - remove resources
  325.     vpb            - print volume ParamBlockRec information
  326.  
  327. #############################################################################
  328. #
  329. #                        UNIX COMMANDS
  330. #
  331. #############################################################################
  332. <U> cal
  333. cal [[month] year] - print calendar
  334. <M> cal
  335.  
  336.     cal [[month] year]
  337.     
  338.     cal prints a calendar for the given year.  If a month is specified then
  339.     only that month is printed.  The year can be between 1 and 9999.  The
  340.     month is a number between 1 and 12.  The year can be specified as 1990,
  341.     or abbreviated to 90.  If neither a month or year is given then the 
  342.     calendar for the current month is printed.
  343.     
  344. #############################################################################
  345. <U> cat
  346. cat [-] files - catenate and print files and/or standard input
  347. <M> cat
  348.  
  349.     cat [-] files
  350.     
  351.     cat reads each file in sequence and writes their contents to the standard
  352.     output.  If not input file is specified or the argument '-' is given then
  353.     cat reads from the standard input.  Output is buffered.
  354.  
  355.     Patterns may be used in the files specification.
  356.     
  357.     options
  358.         -        read from the standard input if files are specified.
  359.  
  360. #############################################################################
  361. <U> cd
  362. cd [option] [path] - change directories
  363. <M> cd
  364.  
  365.     cd [option] [path]
  366.     
  367.     cd changes the current working directory to the specified path.  If a 
  368.     path is not specified then cd uses the shell variable $CDPATH.  If the
  369.     -d option is used then the path is ignored.
  370.  
  371.     options
  372.         -d                use dialog to set directory.
  373.         -i    dirID        set directory to dirID.
  374.  
  375. #############################################################################
  376. <U> cmp
  377. cmp [options] file1 file2 - compare files
  378. <M> cmp
  379.  
  380.     cmp [options] file1 file2
  381.     
  382.     cmp compares two TEXT files. If the files are the same cmp does nothing.
  383.     If they differ the byte offset and differing bytes are printed.
  384.     
  385.     options
  386.         -l        print the line offset and the lines for each difference.
  387.         -s        print nothing for differing files, output return code only.
  388.  
  389. #############################################################################
  390. <U> cp
  391. cp format - copy files in one of two formats
  392. <M> cp
  393.  
  394.     cp file1 file2
  395.     cp files directory
  396.     
  397.     cp copies files.  In the first format file1 is copied to file2.  In the
  398.     second format files are copied into the specified directory.  If file1
  399.     or any name in files is a directory the directory is copied.  cp refuses
  400.     to copy a file onto itself.
  401.  
  402.     Patterns may be used in the files specification.
  403.  
  404.     options - none
  405.  
  406. #############################################################################
  407. <U> cpt
  408. cpt directory1 directory2 - copy directories (trees)
  409. <M> cpt
  410.  
  411.     cp directory1 directory2
  412.     
  413.     cpt copies directories (trees). cpt copies a directory1 to directory2.
  414.     All sub-directories and files are copied. cpt refuses to copy a directory
  415.     onto itself.
  416.  
  417.     options - none
  418.  
  419. #############################################################################
  420. <U> crypt
  421. crypt [options] files - encode files
  422. <M> crypt
  423.  
  424.     crypt [options] files
  425.     
  426.     crypt encrypts characters from the specified file.  Encrypted characters
  427.     are written to a new file (whose name matches the first file with the
  428.     postfix '.crypt'. If no password is supplied a dialog is used to enter it.
  429.     A password specified on the command line is not completely secure, as the
  430.     password is visible to anyone.  You can clear the shells output, and thus
  431.     erase the password, with the clear command.
  432.     
  433.     To encrypt a text file:
  434.     
  435.         $ crypt -p pingaling file
  436.  
  437.     options
  438.         -p    password    use the password for encryption
  439.         -s                    suppress .crypt on newly encrypted file
  440.         
  441. #############################################################################
  442. <U> decrypt
  443. decrypt [options] files  - decode files
  444. <M> decrypt
  445.     decrypt [options] files 
  446.     
  447.     crypt decrypts characters from the specified file.  Decrypted characters
  448.     are written to a new file (whose name matches the first file with the
  449.     postfix '.decrypt'. If no password is supplied a dialog is used to enter it.
  450.     A password specified on the command line is not completely secure, as the
  451.     password is visible to anyone.  You can clear the shells output, and thus
  452.     erase the password, with the clear command.  Note that if file is not found
  453.     decrypt looks for a file named file.crypt.  Thus the following commands 
  454.     perform the same action :
  455.     
  456.         $ decrypt -p pingaling file.crypt
  457.         $ decrypt -p pingaling file
  458.  
  459.     options
  460.         -p    password    use the password for encryption
  461.         -s                    suppress .decrypt on newly decrypted file
  462.         
  463. #############################################################################
  464. <U> date
  465. date - print time and date
  466. <M> date
  467.  
  468.     date
  469.     
  470.     date prints the current time and date.
  471.     
  472.     options - none
  473.  
  474. #############################################################################
  475. <U> df
  476. df [volumes] - show disk (volume) free space
  477. <M> df
  478.  
  479.     df [volumes]
  480.     
  481.     df prints volume free space information to stdout.  If no volume is 
  482.     specified all online volumes are listed.
  483.         
  484.     Patterns may be used in the volumes specification.
  485.  
  486.     options - none
  487.  
  488. #############################################################################
  489. <U> diff
  490. diff - differential file compare
  491. <M> diff
  492.  
  493.     diff [options] file1 file2
  494.  
  495.     diff lists the lines that must be changed to make the two files match.
  496.     Each mismatch is tagged with a < for the first file and a > for the 
  497.     second file.    diff attempts to resync the files for up to 32 lines.
  498.     
  499.     options
  500.         -h        do a fast half-hearted job.
  501.         
  502. #############################################################################
  503. <U> echo
  504. echo - echo arguments to stdout
  505. <M> echo
  506.  
  507.     echo [option] arguments
  508.     
  509.     echo writes the arguments to the standard output separated by the blank
  510.     character and followed by a newline.
  511.     
  512.     options
  513.         -n        no newline is added to the output.
  514.         
  515. #############################################################################
  516. <U> edit
  517. edit [files] - edit text files
  518. <M> edit
  519.  
  520.     edit [files]
  521.     
  522.     edit opens the specified file/s into a new window/s for editing.  If the
  523.     specified file cannot be found a new window is created under the filename.
  524.     When editing a new file, the command line name is take literatly, that is
  525.     no path information is extracted from the file name.  If no file is
  526.     specified then a new Untitled file is openned for editing.
  527.     
  528.     Patterns may be used in the files specification.
  529.  
  530.     options - none
  531.  
  532. #############################################################################
  533. <U> find
  534. find files - find files
  535. <M> find
  536.  
  537.     find [options] files
  538.     
  539.     find searches all volumes for the specified files.  The path to the files
  540.     are printed to standard output.  'find' is equivalent to the command
  541.     'ls //*/.../file'.  To find all (non-open) applications use :
  542.  
  543.     $ find * -t APPL
  544.  
  545.     Patterns may be used in the files specification.
  546.  
  547.     options
  548.         -l                list info about files.
  549.         -t    TYPE        where TYPE is a 4 character file type
  550.         -c     CREA        where CREA is a 4 character file creator
  551.  
  552. #############################################################################
  553. <U> fgrep
  554. fgrep [options] string files - search files for string
  555. <M> fgrep
  556.  
  557.     fgrep [options] string files
  558.     
  559.     fgrep searches files for lines that contain the specified string.  Lines
  560.     with occurrences of the string are printed.
  561.  
  562.     Patterns may be used in the files specification.
  563.  
  564.     options
  565.         -c        print a count of matching lines.    
  566.         -h        don't print file name headers.
  567.         -i        ignore case in making comparisons.
  568.         -n        each line is proceeded by its line number.
  569.         -v        display all lines but those matching.
  570.         -x        only lines that match exactly are printed.
  571.  
  572. #############################################################################
  573. <U> grep
  574. grep [options] pattern files - search files for pattern
  575. <M> grep
  576.  
  577.     grep [options] pattern files
  578.     
  579.     grep searches files for lines that contain the specified pattern.  Lines
  580.     with occurances of the pattern are printed.  The pattern is a not a ed
  581.     pattern, but a standard MacShell pattern (see man patterns).
  582.  
  583.     Patterns may be used in the files specification.
  584.  
  585.     options
  586.         -c        print a count of matching lines.    
  587.         -h        don't print file name headers.
  588.         -i        ignore case in making comparisons.
  589.         -n        each line is proceeded by its line number.
  590.         -v        display all lines but those matching.
  591.  
  592. #############################################################################
  593. <U> hd
  594. hd [options] files - dump files in hex
  595. <M> hd
  596.  
  597.     hd [options] files
  598.     
  599.     hd dumps the files in a specified format.  if no format is given then 
  600.     the hex/ascii format is used.  Options may be combined, for example -ld
  601.     will dump a file as decimal longs and ascii.
  602.     
  603.     Patterns may be used in the files specification.
  604.  
  605.     options
  606.         -n        suppress ASCII dump.
  607.         -l        dump file as longs (32 bit ints, 16 bit is default).
  608.         -d        dump ints in decimal format (HEX is default).
  609.         -r        dump resource fork (data fork is default).
  610.     
  611. #############################################################################
  612. <U> ls
  613. ls [options] names - list files and directories
  614. <M> ls
  615.  
  616.     ls [options] names
  617.     
  618.     ls lists for each directory argument, the contents of that directory, for
  619.     each file argument, information about the file. When the -l option is 
  620.     specified, file sizes, flags, creation and modification dates are printed.
  621.     Flags are printed as : lowercase = False, uppercase = True.
  622.  
  623.     Patterns may be used in the names specification.
  624.  
  625.     options
  626.         -c  CREA        list only entries with finder creator CREA.
  627.         -d                    list directories only.
  628.         -l                    long listing : sizes and attributes.
  629.                                         L   Locked
  630.                                         V   Invisible
  631.                                         B   Bundle
  632.                                         S   System
  633.                                         I   Inited
  634.                                         D   Desktop
  635.                                         M   Shared
  636.                                         A   Always switch launch
  637.                                             
  638.         -t    TYPE        list only entries with finder type TYPE.
  639.         
  640.     Note : when using the long list format, ls searches directories counting
  641.     file sizes to compute the size of a directory.  When searching very large
  642.     directories this format may take several seconds.  When listing volumes
  643.     in the long format the volume size may be listed as 'M' bytes indicating
  644.     megabytes = 1048576 bytes.  Volumes and directories are given fake type
  645.     and creators (in the long format) of 'Volm' and 'Fldr'.
  646.  
  647. #############################################################################
  648. <U> mkdir
  649. mkdir directories - make directories
  650. <M> mkdir
  651.  
  652.     mkdir directories
  653.     
  654.     mkdir creates the specified directories.  mkdir will not replace existing
  655.     directories with new ones.
  656.     
  657.     options - none
  658.  
  659. #############################################################################
  660. <U> mv
  661. mv format - move files in one of two formats
  662. <M> mv
  663.  
  664.     mv file1 file2
  665.     mv files directory
  666.     
  667.     mv moves files.  In the first format file1 is moved to file2.  In the
  668.     second format files are moved into the specified directory.  If file1
  669.     or any name in files is a directory the directory is moved.  mv refuses
  670.     to copy a file onto itself.  mv will move files between volumes.
  671.  
  672.     Patterns may be used in the files specification.
  673.  
  674.     options - none
  675.  
  676. #############################################################################
  677. <U> mvt
  678. mvt directory1 directory2 - move directories (trees)
  679. <M> mvt
  680.  
  681.     mv directory1 directory2
  682.     
  683.     mvt moves directories (trees). mvt moves a directory1 to directory2.
  684.     All sub-directories and files are moved. mvt refuses to move a 
  685.     directory onto itself.
  686.  
  687.     options - none
  688.  
  689. #############################################################################
  690. <U> pr
  691. pr [options] files - print text files
  692. <M> pr
  693.  
  694.     pr [options] files
  695.     
  696.     pr prints text files in the specified format.  The default format can
  697.     be specified with the page setup and print job dialogs.  The initial 
  698.     format is printer dependent.
  699.  
  700.     Patterns may be used in the files specification.
  701.  
  702.     For two column printing (on a LaserWriter) use:
  703.  
  704.         $pr file -2s
  705.  
  706.     then select a scaling of 50% from your printers page-set-up dialog.
  707.  
  708.     options
  709.         -2        print text in two columns. use -s to set scaling.
  710.         -3        print text in three columns. use -s to set scaling.
  711.         -l        print in landscape mode (LaserWriter compatibles).
  712.         -n        suppress headers.
  713.         -s        do pagesetup dialog.
  714.         -j        do print job dialog.
  715.  
  716. #############################################################################
  717. <U> pwd
  718. pwd - print present working directory path
  719. <M> pwd
  720.  
  721.     pwd
  722.     
  723.     pwd prints the path to the present working directory to the standard
  724.     output.  Normally this command is unnecessary as the shells window title
  725.     is the full path to the present working directory.
  726.  
  727. #############################################################################
  728. <U> read
  729. read files - read text files
  730. <M> read
  731.  
  732.     read files
  733.     
  734.     read opens the specified file/s into a new window/s for reading.
  735.  
  736.     Patterns may be used in the files specification.
  737.  
  738.     options - none
  739.  
  740. #############################################################################
  741. <U> rm
  742. rm [options] files - remove files
  743. <M> rm
  744.  
  745.     rm [options] files
  746.     
  747.     rm removes the specified files.  If the -r option is specified then rm
  748.     will recursively delete all files within a directory and then the 
  749.     directory itself.
  750.     
  751.     Patterns may be used in the files specification.
  752.  
  753.     options
  754.         -r        recursively delete a directory.
  755.     
  756. #############################################################################
  757. <U> rmdir
  758. rmdir [options] directories - remove directories
  759. <M> rmdir
  760.  
  761.     rmdir [options] directories
  762.     
  763.     rmdir removes the specified directories.  rmdir will only remove empty
  764.     directories unless the -f option is specified.
  765.     
  766.     options
  767.         -f        force the removal of all sub files and directories
  768.     
  769. #############################################################################
  770. <U> set
  771. set [names] - set shell variables
  772. <M> set
  773.  
  774.     set [names]
  775.     
  776.     set sets shell variables from the specified names.  Each name entry is in
  777.     the format VARIABLE=VALUE.  Type 'man shell' for more information on
  778.     shell variables.
  779.  
  780.     options - none
  781.  
  782. #############################################################################
  783. <U> sh
  784. sh    - open a new shell
  785. <M> sh
  786.  
  787.     sh    - open a new shell
  788.     
  789.     sh opens a new shell in the current directory.
  790.  
  791.     options - none
  792.  
  793. #############################################################################
  794. <U> script
  795. script [options] files - run shell script
  796. <M> script
  797.  
  798.     script [options] files
  799.     
  800.     script executes text files as shell scripts.  Normally this command is not
  801.     used as typing the scripts name is sufficient to execute it.
  802.  
  803.     options
  804.         -v        verbose : echo the scripts commands to the shell.
  805.     
  806. #############################################################################
  807. <U> size
  808. size files - print the size of data and resource forks
  809. <M> size
  810.  
  811.     size files
  812.     
  813.     size prints the disk space used by a files data and resource forks.
  814.  
  815.     Patterns may be used in the files specification.
  816.  
  817.     options - none
  818.  
  819. #############################################################################
  820. <U> sleep
  821. sleep time - suspend execution for an interval (Ticks)
  822. <M> sleep
  823.  
  824.     sleep time
  825.     
  826.     sleep suspends execution for the given time.  The time is specified in
  827.     60th's of a second (Ticks).
  828.     
  829.     options - none
  830.  
  831. #############################################################################
  832. <U> touch
  833. touch files - update the date last modified of files
  834. <M> touch
  835.  
  836.     touch files
  837.     
  838.     touch sets the modified time and date of the specified files to the 
  839.     current time and date.
  840.     
  841.     Patterns may be used in the files specification.
  842.  
  843.     options - none
  844.     
  845. #############################################################################
  846. <U> tr
  847. tr [options] [string1 [string2]] - translate characters
  848. <M> tr
  849.  
  850.     tr [options] [string1 [string2]]
  851.  
  852.     tr copies characters from the standard input to the standard output with
  853.     substitution or deletion of specified characters.  Characters specified
  854.     in string1 are mapped into corresponding characters in string2.  When
  855.     string2 is shorter than string1 it is extended to the length of string1
  856.     by replicating the last character in string2.  If either string contains
  857.     the notation a-z then the range of characters is used.  A '\-' indicates
  858.     the dash character, etc.
  859.     
  860.     options
  861.         -d        delete the input characters that match string1
  862.         -s        squeeze all strings of repeated characters into a single char.
  863.  
  864. #############################################################################
  865. <U> unset
  866. unset names - unset (remove) shell variables
  867. <M> unset
  868.  
  869.     unset names
  870.     
  871.     unset removes the specified shell variables.  Type 'man shell' for more
  872.     information on shell variables.
  873.  
  874.     options - none
  875.  
  876. #############################################################################
  877. <U> wc
  878. wc [options] [files] - count characters, words, and lines in text files
  879. <M> wc
  880.  
  881.     wc [options] [files]
  882.  
  883.     wc counts characters, words, and lines in text files.
  884.     
  885.     Patterns may be used in the files specification.
  886.  
  887.     options
  888.         -c        count characters. 
  889.         -w        count words.
  890.         -l        count lines.
  891.         -f        count files.
  892.     
  893. #############################################################################
  894. #
  895. #                        MACINTOSH SPECIFIC COMMANDS
  896. #
  897. #############################################################################
  898. <U> new
  899. new - open a new shell
  900. <M> new
  901.  
  902.     new
  903.     
  904.     new opens a new shell window to the current working directory.
  905.     new is equivalent to selecting the 'New' item in the 'File' menu.
  906.  
  907.     options - none
  908.  
  909. #############################################################################
  910. <U> addmenu
  911. addmenu menu [item [command]] - add or modify a menu
  912. <M> addmenu
  913.  
  914.     addmenu menu [item [command]]
  915.     
  916.     addmenu adds a new menu and/or item and optionally associates a command
  917.     string with that menu item.  If the menu/item exist, addmenu modifies the
  918.     item to the new information.  The item specification can contain any of
  919.     the standard Macintosh menu manager meta-characters :
  920.     
  921.         /<char>        use <char> as the keyboard equivalent for the item.
  922.         (                    item it disabled.  normal use is '(-' for this option.
  923.         !<char>        use <char> as a item mark.
  924.         ^n                use <char> as an index for a menu item ICON.
  925.         <style        stylize item with one of the following style characters :
  926.                                     B        Bold
  927.                                     I        Italic
  928.                                     U        Underline
  929.                                     O        Outline
  930.                                     S        Shadow
  931.     
  932.     A further explanation of meta-characters and their use can be found in
  933.     Inside Macintosh, volume 1, page 346.  Use of the ';' meta-character will
  934.     add an additional non-functional menu item and thus should not be used.
  935.     
  936.     command is a simple command or a complex command specified as a quoted
  937.     string.  Several shell commands can be specified in the command string,
  938.     for example:
  939.     
  940.         $ addmenu Print 'All Source' 'pr /myProj/.../*.c'
  941.         
  942.     will create an menu item that will print all 'C' source files in the
  943.     directory myProj (and it's sub-directories).  To add a hierarchical menu
  944.     use the addsubmenu command.
  945.     
  946.     options - none
  947.  
  948. #############################################################################
  949. <U> addsubmenu
  950. addsubmenu menu item submenu [subitem [command]] - add a hierarchical menu
  951. <M> addsubmenu
  952.  
  953.     addsubmenu menu item submenu [subitem [command]]
  954.  
  955.     addsubmenu adds a new hierarchical menu and/or item and optionally
  956.     associates a command string with that menu item.  If the menu/item exist,
  957.     addmenu modifies the item to the new information.  The item specification
  958.     can contain any of the standard Macintosh menu manager meta-characters.
  959.     See addmenu for meta-character and command information.
  960.  
  961.     options - none
  962.  
  963. #############################################################################
  964. <U> delmenu
  965. delmenu    menu [item] - remove menu and/or menu items
  966. <M> delmenu
  967.  
  968.     delmenu    menu
  969.     
  970.     delmenu removes menus created with the addmenu command.  If an item is 
  971.     specified the item and its associated command string is removed.
  972.  
  973.     options - none
  974.  
  975. #############################################################################
  976. <U> open
  977. open [files] - open text files for editing
  978. <M> open
  979.  
  980.     open [files]
  981.     
  982.     open is the equivalent of the 'Open╔' item in the File menu.  If files are
  983.     specified the files are openned for editing. If no files are specified then
  984.     the user is prompted with the open file dialog.
  985.  
  986.     options - none
  987.  
  988. #############################################################################
  989. <U> close
  990. close window- close text window
  991. <M> close
  992.  
  993.     close window
  994.     
  995.     close is the equivalent of the 'Close' item in the File menu.  window is
  996.     the title of a current text or shell window.  Patterns may be used in the
  997.     window specification, for example:
  998.     
  999.         $ close *.c
  1000.         
  1001.     will close all open 'C' source windows.
  1002.     
  1003.     options - none
  1004.  
  1005. #############################################################################
  1006. <U> save
  1007. save window- save the contents of window to file
  1008. <M> save
  1009.  
  1010.     save window
  1011.     
  1012.     save is the equivalent of the 'Save' item in the File menu.  window is
  1013.     the title of a current text or shell window.  Patterns may be used in the
  1014.     window specification, for example:
  1015.     
  1016.         $ save *.h
  1017.         
  1018.     will save the contents of all open 'C' header windows.
  1019.     
  1020.     options - none
  1021.  
  1022. #############################################################################
  1023. <U> saveas
  1024. saveas window- save the contents of window to new file
  1025. <M> saveas
  1026.  
  1027.     saveas window
  1028.     
  1029.     saveas is the equivalent of the 'Save As╔' item in the File menu.  window is
  1030.     the title of a current text or shell window.  Patterns may be used in the
  1031.     window specification, for example:
  1032.     
  1033.         $ saveas *.h
  1034.         
  1035.     will prompt the user to save the contents of all open 'C' header windows
  1036.     to new file names.
  1037.     
  1038.     options - none
  1039.  
  1040. #############################################################################
  1041. <U> restart
  1042. restart - restart the Macintosh.
  1043. <M> restart
  1044.  
  1045.     restart
  1046.     
  1047.     restart causes the macintosh to reboot.
  1048.     
  1049.     options - none
  1050.  
  1051. #############################################################################
  1052. <U> shutdown
  1053. shutdown - shutdown the Macintosh.
  1054. <M> shutdown
  1055.  
  1056.     shutdown
  1057.     
  1058.     shutdown causes the macintosh to shutdown.
  1059.     
  1060.     options - none
  1061.  
  1062. #############################################################################
  1063. <U> revert
  1064. revert window - revert text window to last version saved.
  1065. <M> revert
  1066.  
  1067.     revert window
  1068.     
  1069.     revert is the equivalent of the 'Revert' item in the File menu.  window is
  1070.     the title of a current text or shell window.  Patterns may be used in the
  1071.     window specification.
  1072.  
  1073.     options - none
  1074.  
  1075. #############################################################################
  1076. <U> quit
  1077. quit - quit MacShell¬
  1078. <M> quit
  1079.  
  1080.     quit
  1081.     
  1082.     quit is the equivalent of the 'Quit' item in the File menu.
  1083.     
  1084.     options - none
  1085.  
  1086. #############################################################################
  1087. <U> clear
  1088. clear - erase all shell output
  1089. <M> clear
  1090.  
  1091.     clear
  1092.     
  1093.     clear deletes all text in the shells output window.  clear is useful for
  1094.     maintaining a minimum memory profile.
  1095.  
  1096.     options - none
  1097.  
  1098. #############################################################################
  1099. <U> pagesetup
  1100. pagesetup - open page setup dialog
  1101. <M> pagesetup
  1102.  
  1103.     pagesetup
  1104.     
  1105.     pagesetup is the equivalent of the 'Page Setup╔' item in the File menu. 
  1106.     pagesetup opens the Macintosh page setup dialog for the selected printer.
  1107.     If no printer was selected from the chooser then pagesetup does nothing.
  1108.  
  1109.     options - none
  1110.  
  1111. #############################################################################
  1112. <U> prefs
  1113. prefs [options]    - set MacShell preferences
  1114. <M> prefs
  1115.  
  1116.     prefs [options]
  1117.     
  1118.     prefs sets MacShell user preferences. If no options are specified a dialog
  1119.     is used to set the preferences.
  1120.  
  1121.     options
  1122.         -A                use advanced scroll bars.
  1123.         -a                use standard scroll bars.
  1124.         -c CREA            set finder creator for new TEXT files.
  1125.         -P                use '.profile' on startup.
  1126.         -p                do not use '.profile' on startup.
  1127.         -N                use '.profile' on newly openned shells.
  1128.         -n                do not use '.profile' on newly openned shells.
  1129.         -s                'New' menu item opens shell.
  1130.         -f                'New' menu item opens empty file.
  1131.         -l limit        set character limit on open shells.
  1132.                         Minimum limit is 4k, maximum limit is 512k.
  1133.         -i                Case sensitive string and pattern compares.
  1134.         -I                Case insensitive string and pattern compares.
  1135.         
  1136. #############################################################################
  1137. <U> print
  1138. print - open print job dialog
  1139. <M> print
  1140.  
  1141.     print
  1142.     
  1143.     print is the equivalent of the 'Print╔' item in the File menu. 
  1144.  
  1145.     options - none
  1146.  
  1147. #############################################################################
  1148. <U> about
  1149. about - open about dialog
  1150. <M> about
  1151.  
  1152.     about
  1153.     
  1154.     about is the equivalent of the 'About MacShell' item in the Apple menu. 
  1155.  
  1156.     options - none
  1157.  
  1158. #############################################################################
  1159. <U> setfile
  1160. setfile [options] files - set file attributes
  1161. <M> setfile
  1162.  
  1163.     setfile [options] files
  1164.     
  1165.     setfile sets file finder attributes.  setfile is useful for setting the
  1166.     type and creator finder fields in files.
  1167.     
  1168.     Patterns may be used in the files specification.
  1169.  
  1170.     options
  1171.         -a    attributes        Set attributes (lowercase = FALSE, uppercase = TRUE).
  1172.                                             L   Locked
  1173.                                             V   Invisible
  1174.                                             B   Bundle
  1175.                                             S   System
  1176.                                             I   Inited
  1177.                                             D   Desktop
  1178.                                             M   Shared
  1179.                                             A   Always switch launch
  1180.                                             
  1181.         -c creator                Set finder creator.
  1182.         -t    type                Set finder type.
  1183.  
  1184. #############################################################################
  1185. <U> fpb
  1186. fpb files - print file ParamBlockRec information
  1187. <M> fpb
  1188.  
  1189.     fpb files
  1190.  
  1191.     fpb prints Macintosh (File Manager) file information.  The file
  1192.     information is the same information returned by a PBGetFInfo call.
  1193.  
  1194.     Patterns may be used in the files specification.
  1195.  
  1196.     options - none
  1197.  
  1198. #############################################################################
  1199. <U> dpb
  1200. dpb [directories] - print directory ParamBlockRec information
  1201. <M> dpb
  1202.  
  1203.     dpb [directories]
  1204.  
  1205.     dpb prints Macintosh (File Manager) directory information.  The directory
  1206.     information is the same information returned by a PBGetCatInfo call.  If 
  1207.     no directory is specified, information on the current directory is printed.
  1208.  
  1209.     Patterns may be used in the directories specification.
  1210.  
  1211.     options - none
  1212.  
  1213. #############################################################################
  1214. <U> vpb
  1215. vpb [volumes] - print file ParamBlockRec information
  1216. <M> vpb
  1217.  
  1218.     vpb [volumes]
  1219.  
  1220.     vpb prints Macintosh (File Manager) volume information.  The volume
  1221.     information is the same information returned by a PBGetVInfo call.  If 
  1222.     no volume is specified, information on the current volume is printed.
  1223.  
  1224.     Patterns may be used in the directories specification.
  1225.  
  1226.     options - none
  1227.  
  1228. #############################################################################
  1229. <U> environ
  1230. environ        - print information about system environment
  1231. <M> environ
  1232.  
  1233.     environ
  1234.     
  1235.     environ prints information obtained through the trap SysEnvirons.  This 
  1236.     command provides information about the machine you are running on.
  1237.     
  1238.     options - none
  1239.  
  1240. #############################################################################
  1241. <U> sound
  1242. sound [options] level - set sound volume
  1243. <M> sound
  1244.  
  1245.     sound [options] level
  1246.     
  1247.     sound sets the system sound volume to the value specified in level.  level
  1248.     must be a character in the range '0' to '7'.
  1249.  
  1250.     options
  1251.         -s        do not play the current sound (SysBeep) at the new level.
  1252.  
  1253. #############################################################################
  1254. <U> play
  1255. play [options] files - play sound files and resources
  1256. <M> play
  1257.  
  1258.     play [options] files
  1259.     
  1260.     play opens and plays 'snd ' resources.  If a file is not specified then 
  1261.     the current sound is played.  If a file is specified then all sounds in
  1262.     the file are played.  If a resource ID is specified then sounds with the
  1263.     resource ID are played.  Make sure the ID is correct, no checking is 
  1264.     done on the ID string.  Example :
  1265.     
  1266.         $play //*/╔/* -v
  1267.         
  1268.     will play and list every sound on all online volumes.
  1269.  
  1270.     Patterns may be used in the files specification.
  1271.  
  1272.     options
  1273.         -i ID        play 'snd ' resource ID.
  1274.         -v            list resource information as sounds are played.
  1275.     
  1276. #############################################################################
  1277. <U> eject
  1278. eject [options] volumes - eject and unmount volume
  1279. <M> eject
  1280.  
  1281.     eject [options] volumes
  1282.     
  1283.     eject ejects the specified floppy volumes. Patterns may be used in the
  1284.     volumes specification.
  1285.  
  1286.     options
  1287.         -u        unmount volume once ejected.
  1288.  
  1289. #############################################################################
  1290. <U> alias
  1291.     alias [name[=command]] - define or display command alias 
  1292. <M> alias
  1293.  
  1294.     alias [name[=command]]
  1295.     
  1296.     alias defines a string that will be substituted for the alias 'name' on the
  1297.     command line.  alias is used to customize the command environment.  commands
  1298.     that are alias's are global and work in all open shells. You cannot alias 
  1299.     the alias command.  If no '=' is specified then the command for the specified
  1300.     alias is printed.  If no arguments are specified then all alias's are
  1301.     printed, one per line.
  1302.  
  1303.     An example :
  1304.  
  1305.         $ alias dir=ls
  1306.  
  1307.     makes the transition to UNIX a little easier for MSDOS users.
  1308.     
  1309.     options - none
  1310.  
  1311. #############################################################################
  1312. <U> unalias
  1313.     unalias names - undefine command alias 
  1314. <M> unalias
  1315.  
  1316.     unalias names
  1317.     
  1318.     unalias 'undefines' command alias.
  1319.     
  1320.     options - none
  1321.  
  1322. #############################################################################
  1323. <U> lsr
  1324.     lsr    [options] files    - list resources
  1325. <M> lsr
  1326.  
  1327.     lsr    [options] files    - list resources
  1328.     
  1329.     lsr lists resource information in the specified files.  Resources are not
  1330.     loaded into memory, thus very large files can be examined.  If a resource 
  1331.     fork is damaged lsr may run out of memory.
  1332.     
  1333.     lsr lists the following resource information : Type, Type index, Type ID,
  1334.     Flags, Size and Name.
  1335.     
  1336.     The resource flags are printed as : lowercase = False, uppercase = True.
  1337.     The flags are :
  1338.         
  1339.                     S     System Ref
  1340.                     H    Load into system heap.
  1341.                     U    Purgable.
  1342.                     L    Locked.
  1343.                     R    Protected.
  1344.                     P    Preload.
  1345.                     C    Changed.
  1346.  
  1347.     For example to search for virus resources on all volumes use :
  1348.     
  1349.         $ lsr //*/╔/* -t nVIR
  1350.  
  1351.     options
  1352.         -n    name        list resources of the given name (requires type).
  1353.         -i    ids            list resources of the given id's (requires type).
  1354.                         where ids can be 'id' or 'startid,endid'
  1355.         -t    TYPE        list resources of the given type.
  1356.         
  1357. #############################################################################
  1358. <U> cpr
  1359.     cpr file1 type1 id1 file2 [type2 [id2]] - copy resources
  1360. <M> cpr
  1361.  
  1362.     cpr file1 type1 id1 file2 [type2 [id2]]
  1363.     
  1364.     cpr copies resources from file1 to file2.  cpr copies the resource of type1
  1365.     and id1 to a resource of type2 id2. If id2 is not specified then id2 will be
  1366.     the same as id1.  If type2 and id2 are not specified then type1 and id1 will
  1367.     be used.  If file2 is specified as '.' then file1 is used as file2.
  1368.     
  1369.     options - none
  1370.  
  1371. #############################################################################
  1372. <U> mvr
  1373.     mvr file1 type1 id1 file2 [type2 [id2]] - move resources
  1374. <M> mvr
  1375.  
  1376.     mvr file1 type1 id1 file2 [type2 [id2]]
  1377.     
  1378.     mvr moves resources from file1 to file2.  mvr moves the resource of type1
  1379.     and id1 to a resource of type2 id2. If id2 is not specified then id2 will be
  1380.     the same as id1.  If type2 and id2 are not specified then type1 and id1 will
  1381.     be used.  If file2 is specified as '.' then file1 is used as file2.
  1382.     
  1383.     options - none
  1384.  
  1385. #############################################################################
  1386. <U> cmpr
  1387.     cmpr file1 type1 id1 file2 [type2 [id2]] - compare resources
  1388. <M> cmpr
  1389.  
  1390.     cmpr file1 type1 id1 file2 [type2 [id2]]
  1391.     
  1392.     cpr copies resources from file1 to file2.  cpr copies the resource of type1
  1393.     and id1 to a resource of type2 id2. If id2 is not specified then id2 will be
  1394.     the same as id1.  If type2 and id2 are not specified then type1 and id1 will
  1395.     be used.  If file2 is specified as '.' then file1 is used as file2.
  1396.     
  1397.     options - none
  1398.  
  1399. #############################################################################
  1400. <U> rmr
  1401.     rmr file type [id] - remove resources
  1402. <M> rmr
  1403.  
  1404.     rmr file type [id]
  1405.     
  1406.     rmr removes resources from the specified file. The resource    with the given
  1407.     type and id is removed.  If id is not specified then all resources of the
  1408.     given type will be remove.
  1409.     
  1410.     options - none
  1411.  
  1412. #############################################################################
  1413. <U> grepr
  1414. grepr [options] string files - search resources in files for string
  1415. <M> grepr
  1416.  
  1417.     grepr [options] string files
  1418.     
  1419.     grepr searches resources in files for data that match the specified string.
  1420.     Occurrences of the string match are printed.  The string may be specified in
  1421.     a hex format. Searches are performed on byte boundaries. For example,
  1422.     
  1423.         $ grepr -h -t CODE 4E75444F5553 myApplication
  1424.     
  1425.     looks for an instruction sequence in the CODE resources of myApplication.
  1426.  
  1427.     Patterns may be used in the files specification.
  1428.  
  1429.     options
  1430.         -h                pattern is in hex format
  1431.         -n    name        search resources of the given name.
  1432.         -i    ids            search resources of the given id's.
  1433.                         where ids can be 'id' or 'startid,endid'
  1434.         -t    TYPE        search resources of the given type.
  1435.  
  1436. #############################################################################
  1437. <U> dumpr
  1438.     dumpr files [options] - dump file(s) resources in RMAKER format
  1439. <M> dumpr
  1440.  
  1441.     dumpr files [options]
  1442.     
  1443.     dumpr prints resource information in RMAKER format from the specified 
  1444.     files.  dumpr is a resource decompiler. Output from dumpr can be input
  1445.     into RMAKER to create a resource file.  Refer to your THINK C manual,
  1446.     appendix D, page 483 (Version 4.0) for more information on RMAKER.
  1447.     
  1448.     options
  1449.         -n    name        dump resources of the given name.
  1450.         -i    ids            dump resources of the given id's.
  1451.                         where ids can be 'id' or 'startid,endid'
  1452.         -t    TYPE        dump resources of the given type.
  1453.  
  1454. #############################################################################
  1455. <U> clean
  1456.     clean - clean up windows
  1457. <M> clean
  1458.  
  1459.     clean
  1460.     
  1461.     clean 'cleans up' MacShells windows.
  1462.     
  1463.     options - none
  1464.  
  1465. #############################################################################